package com.bit.java1;

public class Test5 {

    public static void secarchDigital(int[] array) {
        for(int i = 0; i < array.length; i++) {
            int count = 1;
            for(int j = i + 1; j < array.length; j++) {
                if(array[i] == array[j]) {
                    count++;
                }
            }
            if(count > array.length / 2) {
                System.out.println(array[i]);
                return ;
            }
        }
        return ;
    }

    public static void main(String[] args) {
        int[] array = {2, 1, 1, 2, 2, 1, 2, 2, 1, 1, 1};
        secarchDigital(array);
    }

}
